go/xenlight: Fix CpuidPoliclyList conversion
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 26 Dec 2019 17:43:17 +0000 (17:43 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 21 Jan 2020 17:48:24 +0000 (17:48 +0000)
commit084974fe715399ba9b4f60be3420f15c68cbfe59
tree86ce80ecee9011b6d6fd2177cafb81e13ff59c98
parent6ddfe66eb22e72391e838c88869e10c372465ae2
go/xenlight: Fix CpuidPoliclyList conversion

Empty Go strings should be converted to `nil` libxl_cpuid_policy_list;
otherwise libxl_cpuid_parse_config gets confused.

Also, libxl_cpuid_policy_list returns a weird error, not a "normal"
libxl error; if it returns one of these non-standard errors, convert
it to ErrorInval.

Finally, make the fromC() method take a pointer, and set the value of
CpuidPolicyList such that it will generate a valid CpuidPolicyList in
response.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Nick Rosbrook <rosbrookn@ainfosec.com>
tools/golang/xenlight/xenlight.go